<?php
class Forumcategory_Model extends MY_Model {
  function __construct(){
    parent::__construct();
    $this->_prefix = "cat";
    $this->_column = array(
                                'id'              => $this->_prefix."_id",
                                'tag_id'          => $this->_prefix."_tag_id",
                                'sort'            => $this->_prefix."_sort",
                                'type'            => $this->_prefix."_type",
                                'description'     => $this->_prefix."_description",
                                'parent_id'       => $this->_prefix."_parent_id"
    );
    $this->_join_column = array(
                                "name" => "tag_name",
                                "url" => "tag_url"
    );
    $this->_table = "ci_category";
  }

  function get($options = NULL){
    $this->db->where($this->_prefix."_type", "forum");
    $this->db->join("ci_tag","ci_tag.tag_id = ci_category.cat_tag_id");
    $mainTable = parent::get($options);
    return $mainTable;
  }

  function add($options = NULL){
    $this->db->set($this->_prefix."_type", "forum");
    $mainTable = parent::add($options);
    return $mainTable;
  }

  function delete($options = NULL){
    $this->db->where($this->_prefix."_type", "forum");
    $mainTable = parent::delete($options);
    return $mainTable;
  }

}

?>